package game.gfx;

import java.awt.Color;

public class ConsoleColor
{
    public static final ConsoleColor DEFAULT = new ConsoleColor(Color.WHITE, Color.BLACK);
    public static final ConsoleColor ERROR   = new ConsoleColor(Color.WHITE, Color.RED);
    
    private final Color foreground;
    private final Color background;
    
    public ConsoleColor(Color foreground, Color background)
    {
        this.foreground = foreground;
        this.background = background;
    }
    
    public ConsoleColor()
    {
        this(DEFAULT.foreground, DEFAULT.background);
    }
    
    public Color getForeground()
    {
        return foreground;
    }
    
    public Color getBackground()
    {
        return background;
    }
    
    @Override
    public boolean equals(Object obj)
    {
        if (obj instanceof ConsoleColor)
        {
            return ((ConsoleColor) obj).getForeground().equals(foreground) &&
                   ((ConsoleColor) obj).getBackground().equals(background);
        }
        return false;
    }
}
